
<h1><?php echo $title; ?></h1>
<div class="noprint">
<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>

<?php if (count($rows) == 0) : ?>
<p class="notice"><?php echo __("Nessuno risultato", $module);?></p>
<?php endif; ?>

<form method='post' action="<?php echo site_url('adozioni/contabilita/offerte/mensili') ?>" >
<div class="filter">
<label for="filter[anno]"><?php echo __("Anno", $module) ?></label>
<select name="filter[anno]">
<?php foreach($anni as $a): ?>
<option value="<?php echo $a['anno'] ?>" <?php if($a['anno'] == $filter['anno']) echo " selected "; ?>><?php echo $a['anno']; ?></option>
<?php endforeach; ?>
</select>

<label for="filter[id_categoria]"><?php echo __("Categoria", $module) ?></label>
<select name="filter[id_categoria]"><option></option>
<?php foreach($categorie as $m): ?>
<option value="<?php echo $m['id'] ?>" <?php if($m['id'] == $filter['id_categoria']) echo " selected "; ?>><?php echo $m['nome']; ?></option>
<?php endforeach; ?>
</select>

<input type="submit" name="submit" value="   <?php echo __('Ok', $module) ?>   " />

</div>
</form>
</div>
<table class="list" cellpadding=3 >
	<thead>
		<tr>
				<th><?php echo __("Mese", $module) ?></th>
				<th><?php echo __("Lordo", $module) ?></th>
				<th><?php echo __("Trattenute", $module) ?></th>
				<th><?php echo __("Netto", $module) ?></th>
		</tr>
	</thead>
	<tbody>
<?php $tot_lordo = $tot_trattenute = $tot_netto = 0; ?>
<?php if (count($rows) > 0) : ?>
<?php $i = 1; foreach ($rows as $row): ?>
<?php if ($i % 2 != 0): $rowClass = 'odd'; else: $rowClass = 'even'; endif;?>
		<tr class="<?php echo $rowClass?>">
				<th style='text-align: left'><?php echo anchor('adozioni/contabilita/offerte/anno/' . $filter['anno'] .'/'. $row['mese'] . '/' . $filter['id_categoria'], $nome_mese[ $row['mese'] ] ) ?></td>
				<td align='right'><?php echo format_euro($row['lordo']) ?></td>
				<td align='right'><?php echo format_euro($row['trattenute']) ?></td>
				<td align='right'><?php echo format_euro($row['netto']) ?></td>				
		</tr>
<?php
$tot_lordo += 		$row['lordo'];
$tot_trattenute += 		$row['trattenute'];
$tot_netto += 		$row['netto'];
?>
<?php $i++; endforeach; ?>		
<?php endif; ?>
		<tr class='total'>
			<th style='text-align: right'><?php echo __("Totale", $module) ?></td>
			<td align='right' class='total'><?php echo format_euro($tot_lordo) ?></td>
			<td align='right' class='total'><?php echo format_euro($tot_trattenute) ?></td>
			<td align='right' class='total'><?php echo format_euro($tot_netto) ?></td>
		</tr>
	</tbody>
</table>	